package com.libertas.jump;

import java.util.ArrayList;
import java.util.HashMap;
import com.libertas.begin.*;
import com.libertas.interfaces.IJumpTable;
import com.libertas.interfaces.IMenu;
public class MenuFirstLoginJump implements IJumpTable, IMenu{
	private static MenuFirstLoginJump instance = null;
	private static String menu[];
	private static ArrayList<String> listarray = new ArrayList<String>();
	private static HashMap<String,Class> activities = new HashMap<String, Class>();
	   protected MenuFirstLoginJump() {
	      // Exists only to defeat instantiation.
		 listarray.add(HomeLandSecurity.getStringResourse(R.string.login_name));
		 listarray.add(HomeLandSecurity.getStringResourse(R.string.view_event));
		 listarray.add(HomeLandSecurity.getStringResourse(R.string.live_news));
		 listarray.add(HomeLandSecurity.getStringResourse(R.string.exit_name));
		 menu = listarray.toArray(new String[listarray.size()]);
		 addActivityClasses();
	   }
	   public static MenuFirstLoginJump getInstance() {
	      if(instance == null) {
	         instance = new MenuFirstLoginJump();
	         
	      }
	      return instance;
	   }
	   public void addActivityClasses(){
		   activities.put(HomeLandSecurity.getStringResourse(R.string.login_name), LoginActivity.class);
		   //activities.put(HomeLandSecurity.getStringResourse(R.string.view_event), ViewReportActivity.class);
		   activities.put(HomeLandSecurity.getStringResourse(R.string.view_event), ViewIncidentInMapActivity.class);
	   }
	   public Class getActivityClass(String actionName){
		   return activities.get(actionName);
	   }
	   public String[] getMenuDescriptor(){
		   return menu;
	   }
}
